namespace Jsl.FxCop
{
    using Microsoft.FxCop.Sdk;
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    [TestClass]
    public class TestComponentsShouldBeLocalizable
    {
        [TestMethod]
        public void Component_is_localizable_so_no_problems()
        {
            new ComponentsShouldBeLocalizable()
                .RunMethodRule(typeof(Targets.ComponentsShouldBeLocalizable_Localizable), "InitializeComponent")
                .HasNoMoreProblems();
        }

        [TestMethod]
        public void Component_not_localizable_so_problems()
        {
            new ComponentsShouldBeLocalizable()
                .RunMethodRule(typeof(Targets.ComponentsShouldBeLocalizable_NotLocalizable), "InitializeComponent")
                .HasProblem(
                    75,
                    FixCategories.NonBreaking,
                    MessageLevel.Warning,
                    "Set the Localizable flag to true.")
                .HasNoMoreProblems();
        }
    }
}
